package com.usian.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.usian.order.dao.TbOrderDao;
import com.usian.order.pojo.TbOrder;
import com.usian.order.service.TbOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TbOrderServiceimpl extends ServiceImpl<TbOrderDao, TbOrder> implements TbOrderService {
    @Autowired
    private TbOrderDao tbOrderDao;
    @Override
    public TbOrder create(String userId,String commodityCode ,int orderCount) {
        TbOrder tbOrder = new TbOrder();
        tbOrder.setUserId(1);
        tbOrder.setCommodity_code(commodityCode);
        tbOrder.setCount(orderCount);
        //TODO 需要知道该商品的单价是多少
        tbOrder.setMoney(1);
//        tbOrderDao.insert(tbOrder);
        tbOrderDao.insertOrder(tbOrder);
        return null;
    }

}
